package com.htl.exampro.question.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;

import lombok.*;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 答题表
 * </p>
 *
 * @author hehehe
 * @since 2025-05-25
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@TableName("answer")
public class AnswerDO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    public static final String ANSWER_ID = "answer_id";
    public static final String USER_ID = "user_id";
    public static final String QUESTION_ID = "question_id";
    public static final String EXAM_ID = "exam_id";
    public static final String PAPER_ID = "paper_id";
    public static final String COURSE_ID = "course_id";
    public static final String ANSWER = "answer";
    public static final String SCORE = "score";
    public static final String Full_SCORE = "full_score";
    public static final String IS_CORRECT = "is_correct";
    public static final String CREATED_PERSON = "created_person";
    public static final String CREATED_TIME = "created_time";
    public static final String UPDATED_PERSON = "updated_person";
    public static final String UPDATED_TIME = "updated_time";
    public static final String IS_DELETED = "is_deleted";

    /**
     * 答题ID
     */
    @TableId(value = "answer_id", type = IdType.ASSIGN_ID)
    private Long answerId;

    /**
     * 考生用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 关联试题ID
     */
    @TableField("question_id")
    private Long questionId;

    /**
     * 考试ID
     */
    @TableField("exam_id")
    private Long examId;

    /**
     * 试卷ID
     */
    @TableField("paper_id")
    private Long paperId;

    /**
     * 课程ID
     */
    @TableField("course_id")
    private Long courseId;

    /**
     * 考生答案
     */
    @TableField("answer")
    private String answer;

    /**
     * 得分
     */
    @TableField("score")
    private Integer score;

    /**
     * 总分
     */
    @TableField("full_score")
    private Integer fullScore;

    /**
     * 是否正确 0-错误 1-正确
     */
    @TableField("is_correct")
    private Byte isCorrect;

    /**
     * 创建人ID
     */
    @TableField(value = "created_person", fill = FieldFill.INSERT)
    private String createdPerson;

    /**
     * 创建时间
     */
    @TableField("created_time")
    private LocalDateTime createdTime;

    /**
     * 修改人ID
     */
    @TableField(value = "updated_person", fill = FieldFill.UPDATE)
    private String updatedPerson;

    /**
     * 修改时间
     */
    @TableField("updated_time")
    private LocalDateTime updatedTime;

    /**
     * 逻辑删除标志 0-未删除 1-已删除
     */
    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted;
}
